package com.itheima.controller;

import com.itheima.common.R;
import com.itheima.service.EmpService;
import com.itheima.service.StudentService;
import com.itheima.vo.JobVo;
import com.itheima.vo.SexVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    EmpService empService;

    @Autowired
    StudentService studentService;

    /*员工性别统计*/
    @GetMapping("/empGenderData")
    public R sex() {
        List<SexVo> sexVo = empService.sex();
        return R.ok(sexVo);
    }

    /*员工职位人数统计*/
    @GetMapping("/empJobData")
    public R job() {
        JobVo jobVo = empService.job();
        return R.ok(jobVo);
    }

    /*学员学历统计*/
    @GetMapping("/studentDegreeData")
    public R studentEducationData() {

        return R.ok(studentService.studentEducationData());
    }

    /*班级人数统计*/
    @GetMapping("/studentCountData")
    public R studentCountData() {
        return R.ok(studentService.studentCountData());
    }
}
